<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript" src="/ssg/web/Public/js/jquery-3.1.1.js"></script>
    <script type="text/javascript" src="/ssg/web/Public/js/cities.js"></script>
    <script type="text/javascript" src="/ssg/web/Public/js/user_Info.js"></script>
</head>
<body>

<div>
    终端用户信息
</div>

<div style="float: left;width: 80%;margin-top: 20px;margin-left: 20px;margin-bottom: 20px">
    <!--搜索-->
    <form method="post" action="" style="float: left">
        <input type="text" name="search"/>
        <button type="submit">搜索</button>
    </form>
    <!--添加终端用户-->
    <button style="float: right" onclick="document.getElementById('add').style.display='Inline'">添加终端用户</button>
</div>
</div>
<br>
<!--表头-->
<br>
<br>
<table width="100%"  border="1">
    <tr bgcolor="aqua" style="height:30px">
        <td style="width: 15%;">账户</td>
        <td style="width: 10%;">昵称</td>
        <td style="width: 5%;">状态</td>
        <td style="width: 10%;">注册系统</td>
        <td style="width: 20%;">注册时间</td>
        <td style="width: 15%;">所属分销商</td>
        <td style="width: 25%;">操作</td>
    </tr>
    <!-----------表格,循环打印，$V.是值------>

    {foreach $result as $k => $v}
    <tr>
        <td>{$v.account}</td>
        <td>{$v.name}</td>
        {if {$v.isValid} == 1}
            <td>有效</td>
            {else }
            <td>失效</td>
        {/if}
        <td>{$v.system}</td>
        <td>{$v.registerTime}</td>
        <td>{if {$v.roleId} == 3}分销商{else}终端用户{/if}</td>
        <td>
            <input type="button"  value="编辑" onclick='user_edit("{$smarty.const.__CONTROLLER__}/user_edit","{$v.id}")'>
            <input type="button"  value="删除" onclick='user_delete("{$smarty.const.__CONTROLLER__}/user_delete","{$v.id}")'>
        </td>
    </tr>
    {/foreach}


</table>
<br>
<br>
<!--分页-->
<div>共{$count}条记录，分为{$sum}页</div>
<div>{$show}</div>
<br>
<!--添加终端用户-->
<br>
<div style="display: none" id="add">
    <form method="post" action="User_info">
        <div>帐号<input type="text" name="user">*</div>
        <div>密码<input type="text" name="password">*</div>
        <div>确认密码<input type="text" name="verify">*</div>
        <div>邀请码<input type="text" name="inviteCode"></div>
        <input type="submit" value="保存" name="user_add">
        <input value="取消" type="submit">
    </form>
</div>

<br>
<br>
<div style="display: Inline" id="edit">
    <div>编辑终端用户</div>
    <form method="post" action="user_edit">
        <input type="hidden" name="re_id" id="re_id">
        <div>手机号码<input type="text" id="re_user" disabled="true"></div>
        <div>注册系统<input type="text" id="re_system" disabled="true"></div>
        <div>注册时间<input type="text" id="re_registerTime" disabled="true"></div>
        <div>邀请码<input type="text" id="inviteCode" disabled="true"></div>
        <div>身份<input type="text" id="re_roleId" disabled="true"></div>
        <div>昵称<input type="text" id="re_name" name="re_name"></div>
        <div>性别
            <select name="re_sex" id="re_sex">
            <option value="0">男</option>
            <option value="1">女</option>
            </select>
        </div>
        <div>年龄<input type="text" id="re_age" name="re_age"></div>
        <div>邮箱<input type="text" id="re_email" name="re_email"></div>
        <div>QQ<input type="text" id="re_qq" name="re_qq"></div>
        <div id="district">地区
            <select id="province" onChange="showWholeList()" name="re_province"></select>
            <select id="city" onChange="showAreaList()" name="re_city"></select>
            <select id="area" name="re_area"></select>*
        </div>
        <div>地址<input type="text" id="re_address" name="re_address"></div>
        <div>状态
            <select id="re_isValid" name="re_isValid">
                <option value="0">冻结</option>
                <option value="1">有效</option>
            </select>
        </div>
        <input type="submit" value="保存" name="user_edit" id="user_edit">
        <input value="取消" type="submit">
    </form>
</div>

<script type="text/javascript" src="/ssg/web/Public/js/user_address.js"></script>
</body>
</html>